package com.example.hometown_walker.exception;

public enum CoreErrorCode implements ErrorCode{

    SUCCESS(0, "success"),
    SYSTEM_PARAM_ERROR(10001, "参数错误"),
    SYSTEM_JSON_PARSE_ERROR(10002, "JSON解析错误"),
    SYSTEM_PARAM_ERROR_TOO_LONG(10003, "字段过长"),
    SYSTEM_PARAM_ERROR_IS_NULL(10004, "字段为空"),
    SYSTEM_PARAM_ERROR_VALID_DATA_RANGE(10005, "字段不在有效的范围内"),
    SYSTEM_STRING_TO_RESPONSE_ERROR(10006, "接口请求返回内容转为Response失败"),
    SYSTEM_UNRECOGNIZED_ERROR(10201, "未识别错误"),
    SYSTEM_ERROR(10301, "系统错误"),
    SYSTEM_FEIGN_ERROR(10401, "系统接口错误"),
    SYSTEM_SIG_ERROR(10302, "签名错误"),
    SYSTEM_APP_ID_ERROR(10303, "app-id 错误"),
    SYSTEM_PARAM_ERROR_SENSITIVE_WORD(10304, "标题或内容包含敏感词语"),
    SYSTEM_FILE_FORMAT_ERROR(10007, "文件格式错误"),

    USER_ACCOUNT_CHANNEL_IS_NULL(20001, "channel is null"),
    USER_ACCOUNT_MOBILE_CODE_ERROR(20002, "手机验证码错误"),
    USER_ACCOUNT_MOBILE_ERROR(20003, "请输入正确的手机号"),
    USER_ACCOUNT_EMAIL_ERROR(20004, "请输入正确的邮箱"),
    USER_ACCOUNT_TOKEN_ERROR(20101, "用户权限错误"),
    USER_ACCOUNT_NO_LOGIN(20102, "未登录"),
    USER_ACCOUNT_PASSWORD_ERROR(20104, "用户名或密码错误"),
    USER_ACCOUNT_EMPTY_FIELD(20105, "用户名或密码不能为空"),
    USER_ACCOUNT_NAME_DUPLICATE(20106, "用户名已经存在"),
    USER_ACCOUNT_NOT_EXISTS(20107, "该用户不存在"),

    SOMETHING_ELSE(88888, "不合预期错误！预期[{0}]，当前[{1}]"),

    DEFAULT(99999, "NULL");

    private int code;

    private String msg;

    CoreErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
